package com.bugbuff.common.utils;


import com.bugbuff.common.pojo.Admin;

public class AdminThreadLocal {

    private static final ThreadLocal<Admin> LOCAL = new ThreadLocal<>();


    private AdminThreadLocal(){

    }

    /**
     *将对象放到threadLocal中
     * @param admin
     */
    public static void set(Admin admin){
        LOCAL.set(admin);
    }

    /**
     *返回当前线程中user对象
     * @return
     */
    public static Admin get(){
        return LOCAL.get();
    }

    /**
     *
     *删除当前线程中user对象
     */
    public static void remove(){
        LOCAL.remove();
    }

}
